<template>
<div>
  用户名：<input type="text" v-model="from.mobile">
  密码：<input type="text" v-model="from.password">
  <button @click="login">登录</button>
</div>
</template>

<script>
export default {
  name: "flask_login",
  data(){
    return{
      from:{}
    }
  },
  methods:{
    login(){
      this.$axios.post('user/login/',this.from).then(res=>{
        if(res.data.code==10010){
          // this.$router.push('')
        }else if(res.data.code==200){
          localStorage.setItem('userid',res.data.list)
          this.$router.push('flask_goods')
        }else {
          alert('密码错误')
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
